home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 36 / 036.d81 / flags in the win (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  3KB  |  122 lines

  1. 0 rem flags quiz
  2. 10 ifx=0thenx=1:load"hi-res text.o",8,1
  3. 20 ifx=1thenx=2:load"unpacker",8,1
  4. 30 ifx=2thenx=3:load"flags.lnk",8,1
  5. 35 poke56,63:clr
  6. 40 :
  7. 50 nq=17:dim a$(nq),sn(nq)
  8. 55 te=50759:xp=2:yp=18
  9. 60 forx=1tonq:reada$(x):sn(x)=x:next
  10. 62 data iowa,new mexico,maryland,alaska,rhode island,texas,alabama
  11. 64 data north carolina,south carolina,wyoming,oregon,nevada,colorado
  12. 66 data district of columbia,california,indiana,massachusetts
  13. 70 :
  14. 75 gosub 1000:sys51459
  15. 77 :
  16. 80 c=0:w=0:forx=1tonq:a=int(rnd(1)*nq)+1:b=int(rnd(1)*nq)+1
  17. 82 t$=a$(a):a$(a)=a$(b):a$(b)=t$
  18. 83 t=sn(a):sn(a)=sn(b):sn(b)=t
  19. 84 nextx
  20. 90 :
  21. 100 forx=1tonq
  22. 110 gosub 1000 : rem blank screen
  23. 120 gosub 2000 : rem plot shp#sn(x)
  24. 130 gosub 3000 : rem ask question
  25. 132 fl=0
  26. 140 gosub 4000 : rem get/check answer
  27. 150 iffl=1thengosub5000:goto110: rem quit?
  28. 160 next x
  29. 170 goto 6000  : rem evaluation
  30. 180 :
  31. 1000 rem plot blank
  32. 1010 gosub 10000: rem set stuff
  33. 1020 poke255,0:sys51462:ag=3.3
  34. 1030 return
  35. 1040 :
  36. 2000 rem plot shp#x
  37. 2010 gosub 10000: rem set stuff
  38. 2020 poke255,sn(x):poke253,10:poke254,2:sys51462:ag=3.3
  39. 2030 return
  40. 2040 :
  41. 3000 rem ask question
  42. 3010 syste,"this is the flag of which state?",xp*8,yp*8
  43. 3020 syste,"press [f1] to exit",xp*8,(yp+1)*8
  44. 3030 return
  45. 3040 :
  46. 4000 rem get/check answer
  47. 4010 gosub 11000 : rem hi-res input
  48. 4011 fora=3to5:syste,"                                        ",xp*8,(yp+a)*8
  49. 4012 next
  50. 4015 iffl=1then4100
  51. 4020 if in$<>a$(x) then 4050
  52. 4030 syste,"             correct!                ",xp*8,(yp+3)*8:c=c+1:goto4100
  53. 4050 syste,"incorrect!  the correct state is:      ",xp*8,(yp+3)*8:w=w+1
  54. 4051 mm=20-len(a$(x))/2-4
  55. 4052 syste,a$(x),(xp+mm)*8,(yp+4)*8:poke198,.
  56. 4053 rem     syste,"the correct state is: "+a$(x),(xp+mm)*8,(yp+4)*8:poke198,.
  57. 4100 syste,"press any key to continue...",(xp+3)*8,(yp+5)*8
  58. 4105 geta$:ifa$=""then4105
  59. 4110 return
  60. 5000 rem quit?
  61. 5010 gosub 1000
  62. 5020 syste,"are you sure you want to quit [y/n]",xp*8,yp*8
  63. 5030 poke198,0:wait198,1:geta$
  64. 5040 ifa$<>"y"anda$<>"n"anda$<>"[217]"anda$<>"[206]"then5030
  65. 5050 ifa$="y"ora$="[217]"then 60000
  66. 5060 return
  67. 5070 :
  68. 6000 rem evaluation
  69. 6010 gosub 1000
  70. 6020 s$="out of"+str$(nq)+" asked, you got"+str$(c)+" correct."
  71. 6022 syste,s$,xp*8,(yp-9)*8
  72. 6030 pc=int((c/nq)*100)
  73. 6040 s$="this averages out to"+str$(pc)+"% correct."
  74. 6042 syste,s$,xp*8,(yp-8)*8
  75. 6050 ifpc>=90 thens$="this is an excellent score.":goto6100
  76. 6060 ifpc>=80 thens$="this is an above average score.":goto6100
  77. 6070 ifpc>=70 thens$="this is an average score.":goto6100
  78. 6080 ifpc>=60 thens$="this is a below average score.":goto6100
  79. 6090 s$="this is a very poor score."
  80. 6100 syste,s$,xp*8,(yp-7)*8
  81. 6105 syste,"press any key",(xp+10)*8,yp*8
  82. 6107 poke198,0:wait198,1:poke198,0
  83. 6110 :
  84. 7000 rem play again
  85. 7010 gosub 1000
  86. 7020 syste,"press [return] to return to loadstar",xp*8,(yp-5)*8
  87. 7022 syste,"any other key to play again",(xp+5)*8,(yp-4)*8
  88. 7030 poke198,0:wait198,1:getag$
  89. 7040 ifag$=chr$(13)then60000
  90. 7045 goto80
  91. 7050 :
  92. 10000 rem set stuff
  93. 10010 poke249,224:poke250,204
  94. 10020 poke251,0:poke252,64
  95. 10030 poke253,0:poke254,0
  96. 10040 return
  97. 10050 :
  98. 11000 rem hi-res input
  99. 11010 a$=""
  100. 11020 xi=2:yi=23
  101. 11030 getk$:ifk$<>""then11070
  102. 11040 ifcr$="["thencr$="]":goto11060
  103. 11050 cr$="["
  104. 11060 sys50759,cr$,xi*8,yi*8:goto11030
  105. 11070 ifk$=chr$(13)then11150
  106. 11072 ifk$="[133]"thenfl=1:goto11150
  107. 11080 ifk$<>"[157]"andk$<>chr$(20)then11100
  108. 11090 ifxi>2thenxi=xi-1:sys50759,"  ",xi*8,yi*8:a$=left$(a$,len(a$)-1):goto11030
  109. 11100 ifk$>="[193]"andk$<="[218]"thenk$=chr$(asc(k$)-128)
  110. 11105 if(k$>"z"ork$<"a")andk$<>" "andk$<>"."then11030
  111. 11110 ifxi=38then11030
  112. 11120 sys50759,k$,xi*8,yi*8:xi=xi+1
  113. 11130 a$=a$+k$
  114. 11140 goto11030
  115. 11150 in$=a$:return
  116. 60000 rem quit
  117. 60010 sys51459:print"[147]"
  118. 60020 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  119. 60030 ifer<>63thenpoke56,160:clr:end
  120. 60040 poke56,160:clr:load"hello connect",8
  121. 60050 end
  122.